Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fine-grained features to control the compilation #189

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

Xynnn007
Copy link
Member

Summary

This pr tries to divide different modules (like fulcio, rekor and cosign) into different features. The dependencies of the unenabled features will not be compiled to save space and time.

Release Note

New features are introduced, including

  • full-native-tls, full-rustls-tls: full stack
  • fulcio-native-tls, fulcio-rustls-tls: fulcio
  • rekor-native-tls, rekor-rustls-tls: rekor
  • cosign-native-tls, cosign-rustls-tls: cosign
  • mock-client-native-tls, mock-client-rustls-tls: mock client for test
  • cached-client: whether uses cached-client option

Documentation

Close #187

@Xynnn007 Xynnn007 changed the title Feat features Add fine-grained features to control the compilation Jan 13, 2023
Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, that's a monumental contribution. Thanks!

I left some minor comments, feel free to ignore the suggestion about using cfg-if.

There's however another thing I would like to see: can you update the inline documentation to explain the different features and what their purpose is? I imagine something like tokio documentation does here

src/cosign/client_builder.rs Outdated Show resolved Hide resolved
src/cosign/client_builder.rs Outdated Show resolved Hide resolved
lukehinds
lukehinds previously approved these changes Jan 30, 2023
Copy link
Member

@lukehinds lukehinds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks, just a merge conflict to resolve along with the discussion with @flavio

Some dependencies are only used in a part of the lib.
New features are brought for users to specify to reduce
useless dependencies.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
To run the examples correctly, the simplest way is to
enable all the features.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
@Xynnn007
Copy link
Member Author

Xynnn007 commented Feb 7, 2023

The clippy errors seem not related to this PR. Let me fix them in another PR first, although a great headache :-(

@Xynnn007
Copy link
Member Author

Xynnn007 commented Feb 7, 2023

Well, related work has been done in #210. Great work @danbev ! Let's wait for that PR and let me rebase.

Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for having made the changes I request. This is a really cool PR 👏

@flavio flavio merged commit 01acef6 into sigstore:main Feb 7, 2023
@Xynnn007 Xynnn007 deleted the feat-features branch February 7, 2023 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define fine-grained feature to decrease the compiled size
3 participants